package cn.parllay.dingdangproject.utils;

import android.content.Context;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

// 模型层全局类
public class Model {

    private static Model instace;
    private Context mContext;
    private ExecutorService executorService = Executors.newCachedThreadPool();

    //私有化构造器
    private Model() {

    }
    // 模型层单例对象获取
    public static Model getInstance() {
        if (instace == null) {
            synchronized (Model.class) {
                if (instace == null) {
                    instace = new Model();
                }
            }
        }
        return instace;
    }

    // 获取全局线程池方法
    public ExecutorService getGlobleThreadPool(){
        return executorService;
    }

    // 模型层数据初始化
    public void init(Context context) {
        mContext = context;
        // 初始化数据库的管理类
//        initDataBase();
    }


}
